export interface ClassToggles {
  [K: string]: boolean
}

function classes(...names: (string | ClassToggles)[]) {
  const _names = names.map(item => typeof item === 'string' ? {[item]: true} : item);
  return Object.entries(Object.assign({}, ..._names))
    .filter(kv => kv[1])
    .map(kv => kv[0])
    .join(' ')
}

export default classes;